package cn.nexd.app.indoor.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by wangxu on 16/3/4.
 */
public class GridViewModel implements Parcelable {

    public static final Creator<GridViewModel> CREATOR = new Creator<GridViewModel>() {
        @Override
        public GridViewModel createFromParcel(Parcel in) {
            return new GridViewModel(in);
        }

        @Override
        public GridViewModel[] newArray(int size) {
            return new GridViewModel[size];
        }
    };
    private int resourceId;
    private String itemName;
    private String itemCode;

    protected GridViewModel(Parcel in) {
        resourceId = in.readInt();
        itemName = in.readString();
        itemCode = in.readString();
    }

    public GridViewModel(int resourceId, String itemName, String itemCode) {
        this.resourceId = resourceId;
        this.itemName = itemName;
        this.itemCode = itemCode;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(resourceId);
        dest.writeString(itemName);
        dest.writeString(itemCode);
    }

    public int getResourceId() {
        return resourceId;
    }

    public void setResourceId(int resourceId) {
        this.resourceId = resourceId;
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public String getItemCode() {
        return itemCode;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }
}
